package com.itheima.reggie.converter;

import com.alibaba.excel.converters.Converter;
import com.alibaba.excel.enums.CellDataTypeEnum;
import com.alibaba.excel.metadata.CellData;
import com.alibaba.excel.metadata.GlobalConfiguration;
import com.alibaba.excel.metadata.property.ExcelContentProperty;

public class StringSexConverter implements Converter<String> {

	@Override
	public Class<String> supportJavaTypeKey() {
		return null;
	}

	@Override
	public CellDataTypeEnum supportExcelTypeKey() {
		return null;
	}

	@Override
	public String convertToJavaData(CellData cellData, ExcelContentProperty contentProperty,
										   GlobalConfiguration globalConfiguration) {
		return null;
	}

	@Override
	public CellData<String> convertToExcelData(String value, ExcelContentProperty contentProperty,
	                                           GlobalConfiguration globalConfiguration) {
		if (value.equals("1")){
			return new CellData("男");
		}else {
			return new CellData("女");
		}
	}
}
